Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Earner Manager #100

Open
wants to merge 1 commit into
base: feat/no-claim-on-transfer-2
Choose a base branch
from

Conversation

deluca-mike
Copy link
Collaborator

No description provided.

@deluca-mike deluca-mike added the enhancement New feature or request label Jan 13, 2025
@deluca-mike deluca-mike self-assigned this Jan 13, 2025
Copy link

github-actions bot commented Jan 13, 2025

LCOV of commit bb87072 during Forge Coverage #571

Summary coverage rate:
  lines......: 99.2% (374 of 377 lines)
  functions..: 98.7% (74 of 75 functions)
  branches...: 90.2% (46 of 51 branches)

Files changed coverage rate:
                                 |Lines       |Functions  |Branches    
  Filename                       |Rate     Num|Rate    Num|Rate     Num
  =====================================================================
  src/EarnerManager.sol          |18.8%     80| 133%    15|    -      0
  src/WrappedMToken.sol          |20.1%    269|58.5%    53|    -      0
  src/WrappedMTokenMigratorV1.sol|19.0%     21| 0.0%     4|    -      0

@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 869827e to 4c1d530 Compare January 13, 2025 21:59
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 4c1d530 to 2c7cfc7 Compare January 14, 2025 18:43
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 2c7cfc7 to afbf5fc Compare January 14, 2025 19:17
script/DeployProduction.s.sol Outdated Show resolved Hide resolved
script/DeployProduction.s.sol Outdated Show resolved Hide resolved
src/EarnerManager.sol Show resolved Hide resolved
src/interfaces/IEarnerManager.sol Outdated Show resolved Hide resolved
src/interfaces/IEarnerManager.sol Outdated Show resolved Hide resolved
src/interfaces/IEarnerManager.sol Outdated Show resolved Hide resolved
src/interfaces/IEarnerManager.sol Show resolved Hide resolved
Copy link
Contributor

@toninorair toninorair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, any extra changes comparing to the last approved/merged/audited version ?

@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch 2 times, most recently from 455dd19 to 430773c Compare January 16, 2025 17:47
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 430773c to d3acb5a Compare January 16, 2025 17:49
@deluca-mike
Copy link
Collaborator Author

looks good, any extra changes comparing to the last approved/merged/audited version ?

Other than more tests, there should not be.

@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from d3acb5a to 7d256ec Compare January 16, 2025 20:40
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 7d256ec to 8d7134c Compare January 16, 2025 21:49
@deluca-mike deluca-mike force-pushed the feat/earner-manager branch 3 times, most recently from 821a060 to 1d2c2b0 Compare January 17, 2025 15:56
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 8d7134c to 2c9338d Compare January 17, 2025 19:04
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 2c9338d to dfb97c4 Compare January 17, 2025 19:39
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from dfb97c4 to 72915e7 Compare January 17, 2025 19:46
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from 72915e7 to d9b89fd Compare January 20, 2025 17:14
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from d9b89fd to c1d9903 Compare January 21, 2025 18:57
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch from c1d9903 to 99fe3ce Compare January 21, 2025 19:02
@deluca-mike deluca-mike force-pushed the feat/set-claim-recipient branch 2 times, most recently from be37ff9 to a044c21 Compare January 21, 2025 20:24
Base automatically changed from feat/set-claim-recipient to v2 February 6, 2025 20:10
@deluca-mike deluca-mike changed the base branch from v2 to feat/no-claim-on-transfer-2 February 7, 2025 08:52
@deluca-mike deluca-mike force-pushed the feat/no-claim-on-transfer-2 branch from 8e8c1fd to 5d25f34 Compare February 7, 2025 08:57
Copy link

github-actions bot commented Feb 7, 2025

Changes to gas cost

Generated at commit: 3606da3391dae64d18fe4b1d04b4612ad5d8393d, compared to commit: 8e8c1fd508f99efcd924539875ff415a11e985d2

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
WrappedMTokenHarness balanceOf
claimFor
disableEarning
enableEarning
totalSupply
unwrap(address)
+74 ❌
+13,359 ❌
-3,100 ✅
-5,667 ✅
-261 ✅
-3,653 ✅
+10.35%
+78.95%
-16.25%
-11.05%
-11.39%
-6.66%
MockRegistrar listContains -486 ✅ -18.44%
WrappedMToken startEarningFor
stopEarningFor
+8,073 ❌
+5,486 ❌
+15.90%
+10.49%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
WrappedMTokenHarness 5,637,744 (+355,523) EARNERS_LIST_NAME
MIGRATOR_KEY_PREFIX
accruedYieldOf
balanceOf
balanceWithYieldOf
claimExcess
claimFor
claimRecipientFor
currentIndex
decimals
disableEarning
earningPrincipalOf
enableEarning
excess
getAccountOf
getInternalClaimRecipientOf
implementation
internalUnwrap
internalWrap
isEarning
isEarningEnabled
mToken
pushEnableDisableEarningIndex
setAccountOf(address,uint256)
setClaimRecipient
setEarningPrincipalOf
setInternalClaimRecipient
setRoundingError
setTotalEarningPrincipal
setTotalEarningSupply
setTotalNonEarningSupply
symbol
totalAccruedYield
totalEarningPrincipal
totalEarningSupply
totalNonEarningSupply
totalSupply
transfer
unwrap(address)
unwrap(address,uint256)
wasEarningEnabled
wrap(address)
wrap(address,uint256)
wrapWithPermit(address,uint256,uint256,bytes)
wrapWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)
307 (+23)
330 (+44)
675 (-6)
612 (-6)
914 (-50)
15,111 (-22)
5,224 (-6)
843 (-6)
805 (0)
293 (-22)
8,758 (-36)
615 (-6)
8,777 (-14)
3,106 (-22)
958 (+79)
611 (-6)
435 (+23)
722 (-12)
16,880 (-12)
605 (-28)
502 (+22)
293 (-23)
10,609 (+22)
5,279 (+74)
9,346 (+39)
5,526 (-6)
22,658 (-29)
2,593 (0)
2,561 (0)
2,560 (0)
2,539 (0)
1,431 (-22)
1,481 (+44)
404 (-22)
415 (+23)
414 (0)
512 (-22)
3,161 (-6)
2,748 (-6)
508 (+17)
395 (-22)
17,639 (-35,033)
507 (+16)
4,802 (-28)
4,246 (-6)
+8.10%
+15.38%
-0.88%
-0.97%
-5.19%
-0.15%
-0.11%
-0.71%
0.00%
-6.98%
-0.41%
-0.97%
-0.16%
-0.70%
+8.99%
-0.97%
+5.58%
-1.63%
-0.07%
-4.42%
+4.58%
-7.28%
+0.21%
+1.42%
+0.42%
-0.11%
-0.13%
0.00%
0.00%
0.00%
0.00%
-1.51%
+3.06%
-5.16%
+5.87%
0.00%
-4.12%
-0.19%
-0.22%
+3.46%
-5.28%
-66.51%
+3.26%
-0.58%
-0.14%
307 (+23)
330 (+44)
1,334 (-10)
789 (+74)
1,765 (-50)
26,643 (+1,264)
30,279 (+13,359)
3,390 (-6)
1,414 (+5)
293 (-22)
15,979 (-3,100)
615 (-6)
45,627 (-5,667)
4,749 (-15)
1,958 (+79)
1,111 (-6)
435 (+23)
31,192 (-12)
44,287 (-12)
605 (-28)
1,168 (+22)
293 (-23)
44,601 (-34)
24,605 (-64)
22,612 (+39)
5,526 (-6)
22,658 (-29)
6,361 (+162)
21,059 (-230)
20,998 (-416)
21,585 (-72)
1,431 (-22)
1,827 (+110)
1,914 (-50)
1,478 (+23)
1,324 (+23)
2,030 (-261)
23,548 (-207)
51,223 (-3,653)
49,704 (-2,482)
1,061 (-22)
58,541 (-903)
56,566 (-863)
58,924 (-916)
58,372 (-894)
+8.10%
+15.38%
-0.74%
+10.35%
-2.75%
+4.98%
+78.95%
-0.18%
+0.35%
-6.98%
-16.25%
-0.97%
-11.05%
-0.31%
+4.20%
-0.54%
+5.58%
-0.04%
-0.03%
-4.42%
+1.92%
-7.28%
-0.08%
-0.26%
+0.17%
-0.11%
-0.13%
+2.61%
-1.08%
-1.94%
-0.33%
-1.51%
+6.41%
-2.55%
+1.58%
+1.77%
-11.39%
-0.87%
-6.66%
-4.76%
-2.03%
-1.52%
-1.50%
-1.53%
-1.51%
307 (+23)
330 (+44)
1,630 (-6)
612 (-6)
2,404 (-50)
17,628 (-22)
10,241 (+2,502)
2,268 (-6)
1,322 (0)
293 (-22)
10,954 (-8,675)
615 (-6)
45,627 (-16,969)
4,605 (-22)
958 (+79)
611 (-6)
435 (+23)
31,662 (-12)
45,799 (-12)
605 (-28)
502 (+22)
293 (-23)
44,759 (+22)
25,179 (+74)
12,146 (+39)
5,526 (-6)
22,658 (-29)
5,393 (0)
22,461 (0)
22,460 (0)
22,439 (0)
1,431 (-22)
1,998 (+44)
2,404 (-22)
2,415 (+23)
414 (0)
2,512 (-22)
15,794 (-6)
48,784 (-11,468)
48,674 (+17)
395 (-22)
52,666 (-8,194)
51,801 (+16)
53,585 (-4,122)
53,033 (-4,100)
+8.10%
+15.38%
-0.37%
-0.97%
-2.04%
-0.12%
+32.33%
-0.26%
0.00%
-6.98%
-44.19%
-0.97%
-27.11%
-0.48%
+8.99%
-0.97%
+5.58%
-0.04%
-0.03%
-4.42%
+4.58%
-7.28%
+0.05%
+0.29%
+0.32%
-0.11%
-0.13%
0.00%
0.00%
0.00%
0.00%
-1.51%
+2.25%
-0.91%
+0.96%
0.00%
-0.87%
-0.04%
-19.03%
+0.03%
-5.28%
-13.46%
+0.03%
-7.14%
-7.18%
307 (+23)
330 (+44)
2,165 (-6)
2,612 (-6)
2,404 (-50)
52,396 (-22)
134,415 (+47,543)
8,181 (-6)
2,805 (0)
293 (-22)
28,225 (-40)
615 (-6)
82,478 (-18)
11,119 (-22)
4,958 (+79)
2,611 (-6)
435 (+23)
62,702 (-12)
65,699 (-12)
605 (-28)
2,502 (+22)
293 (-23)
44,759 (+22)
25,179 (+74)
46,346 (+39)
5,526 (-6)
22,658 (-29)
22,493 (0)
22,461 (0)
22,460 (0)
22,439 (0)
1,431 (-22)
3,481 (+44)
2,404 (-22)
2,415 (+23)
2,414 (0)
2,512 (-22)
42,049 (-51,158)
62,763 (+20)
62,614 (+17)
2,395 (-22)
115,240 (+14,580)
114,375 (+14,602)
116,159 (+14,558)
115,607 (+14,580)
+8.10%
+15.38%
-0.28%
-0.23%
-2.04%
-0.04%
+54.73%
-0.07%
0.00%
-6.98%
-0.14%
-0.97%
-0.02%
-0.20%
+1.62%
-0.23%
+5.58%
-0.02%
-0.02%
-4.42%
+0.89%
-7.28%
+0.05%
+0.29%
+0.08%
-0.11%
-0.13%
0.00%
0.00%
0.00%
0.00%
-1.51%
+1.28%
-0.91%
+0.96%
0.00%
-0.87%
-54.89%
+0.03%
+0.03%
-0.91%
+14.48%
+14.64%
+14.33%
+14.43%
1 (0)
1 (0)
341 (+1)
1,972 (+94)
7 (0)
100 (0)
107 (+4)
4 (0)
3,451 (-55)
1 (0)
3 (-1)
169 (-6)
2 (-1)
112 (+1)
4 (0)
4 (0)
1 (0)
9 (0)
6 (0)
147 (-6)
3 (0)
1 (0)
650 (-21)
818 (+60)
3 (0)
1 (0)
2 (0)
206 (+1)
729 (-58)
532 (-59)
910 (+61)
1 (0)
127 (0)
784 (-65)
1,113 (-115)
1,268 (+96)
108 (+1)
213 (0)
101 (0)
102 (0)
3 (0)
101 (0)
103 (0)
102 (0)
102 (0)
MockRegistrar 180,227 (-12) get
listContains
set
setListContains
405 (0)
636 (-2,000)
44,020 (-372)
22,512 (0)
0.00%
-75.87%
-0.84%
0.00%
2,081 (-315)
2,150 (-486)
44,319 (-73)
44,233 (+178)
-13.15%
-18.44%
-0.16%
+0.40%
2,405 (0)
2,636 (0)
44,392 (0)
44,436 (+12)
0.00%
0.00%
0.00%
+0.03%
2,405 (0)
2,636 (0)
44,392 (0)
44,448 (+24)
0.00%
0.00%
0.00%
+0.05%
142 (-89)
103 (-67)
67 (+15)
107 (-12)
WrappedMToken 5,073,509 (+302,605) EARNERS_LIST_NAME
accruedYieldOf
approve
balanceOf
claimExcess
claimFor
claimRecipientFor
decimals
enableEarning
implementation
isEarning
isEarningEnabled
mToken
migrate()
migrate(address)
startEarningFor
stopEarningFor
symbol
totalAccruedYield
totalEarningSupply
transfer
transferFrom
unwrap(address)
unwrap(address,uint256)
wrap
wrapWithPermit(address,uint256,uint256,bytes)
wrapWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)
306 (+44)
675 (+17)
7,506 (-6)
655 (-6)
75,921 (+48)
30,506 (+171)
3,970 (+17)
315 (-22)
82,410 (-5)
434 (+44)
2,607 (-6)
2,502 (+45)
293 (-44)
20,808 (-22)
15,464 (-6)
46,741 (-2,631)
51,613 (+15)
1,474 (+66)
1,947 (+1)
414 (+23)
41,871 (-6)
32,801 (-12)
48,767 (+29)
48,679 (+7)
42,893 (+86)
127,776 (+129)
166,192 (+64)
+16.79%
+2.58%
-0.08%
-0.91%
+0.06%
+0.56%
+0.43%
-6.53%
-0.01%
+11.28%
-0.23%
+1.83%
-13.06%
-0.11%
-0.04%
-5.33%
+0.03%
+4.69%
+0.05%
+5.88%
-0.01%
-0.04%
+0.06%
+0.01%
+0.20%
+0.10%
+0.04%
306 (+44)
2,675 (+17)
24,526 (-6)
1,105 (-6)
75,921 (+48)
38,553 (+177)
3,970 (+17)
315 (-22)
82,410 (-5)
434 (+44)
2,607 (-6)
2,502 (+45)
293 (-44)
20,808 (-22)
15,464 (-6)
58,860 (+8,073)
57,771 (+5,486)
1,474 (+66)
2,345 (+1)
414 (+23)
56,172 (-6)
41,045 (-12)
48,767 (+29)
79,450 (+7)
50,322 (+86)
127,776 (+129)
166,192 (+64)
+16.79%
+0.64%
-0.02%
-0.54%
+0.06%
+0.46%
+0.43%
-6.53%
-0.01%
+11.28%
-0.23%
+1.83%
-13.06%
-0.11%
-0.04%
+15.90%
+10.49%
+4.69%
+0.04%
+5.88%
-0.01%
-0.03%
+0.06%
+0.01%
+0.17%
+0.10%
+0.04%
306 (+44)
2,758 (+17)
24,606 (-6)
655 (-6)
75,921 (+48)
31,404 (+171)
3,970 (+17)
315 (-22)
82,410 (-5)
434 (+44)
2,607 (-6)
2,502 (+45)
293 (-44)
20,808 (-22)
15,464 (-6)
58,993 (+8,522)
57,771 (+5,486)
1,474 (+66)
2,574 (+1)
414 (+23)
59,741 (-6)
45,879 (-12)
48,767 (+29)
80,220 (+7)
48,493 (+86)
127,776 (+129)
166,192 (+64)
+16.79%
+0.62%
-0.02%
-0.91%
+0.06%
+0.55%
+0.43%
-6.53%
-0.01%
+11.28%
-0.23%
+1.83%
-13.06%
-0.11%
-0.04%
+16.88%
+10.49%
+4.69%
+0.04%
+5.88%
-0.01%
-0.03%
+0.06%
+0.01%
+0.18%
+0.10%
+0.04%
306 (+44)
9,258 (+17)
24,606 (-6)
2,655 (-6)
75,921 (+48)
53,750 (+188)
3,970 (+17)
315 (-22)
82,410 (-5)
434 (+44)
2,607 (-6)
2,502 (+45)
293 (-44)
20,808 (-22)
15,464 (-6)
70,193 (+8,522)
63,929 (+10,956)
1,474 (+66)
2,574 (+1)
414 (+23)
76,258 (-6)
47,879 (-12)
48,767 (+29)
107,570 (+7)
118,903 (+86)
127,776 (+129)
166,192 (+64)
+16.79%
+0.18%
-0.02%
-0.23%
+0.06%
+0.35%
+0.43%
-6.53%
-0.01%
+11.28%
-0.23%
+1.83%
-13.06%
-0.11%
-0.04%
+13.82%
+20.68%
+4.69%
+0.04%
+5.88%
-0.01%
-0.03%
+0.06%
+0.01%
+0.07%
+0.10%
+0.04%
1 (0)
501 (0)
216 (0)
1,862 (0)
1 (0)
3 (0)
5 (0)
1 (0)
3 (0)
2 (0)
2 (0)
2 (0)
4 (0)
1 (0)
1 (0)
124 (0)
2 (0)
1 (0)
49 (0)
45 (0)
324 (0)
216 (0)
1 (0)
8 (0)
216 (0)
1 (0)
1 (0)
MockM 534,344 (0) balanceOf
currentIndex
setBalanceOf
setCurrentIndex
setPrincipalBalanceOf
571 (0)
334 (0)
24,181 (0)
26,568 (0)
24,239 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
1,431 (-1)
757 (-8)
43,606 (-199)
43,459 (+1)
44,013 (+598)
-0.07%
-1.05%
-0.45%
+0.00%
+1.38%
571 (0)
334 (0)
44,129 (-12)
43,692 (0)
44,187 (-12)
0.00%
0.00%
-0.03%
0.00%
-0.03%
2,571 (0)
2,334 (0)
44,261 (0)
43,692 (0)
44,307 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
2,363 (-11)
2,890 (-154)
827 (+1)
1,261 (+7)
201 (+1)
Proxy 104,329 (0) fallback 432 (0) 0.00% 22,212 (-104) -0.47% 2,701 (0) 0.00% 143,258 (+86) +0.06% 16,296 (+105)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants